package basics.proxy.dynamicProxy;

import java.lang.reflect.Proxy;

import basics.proxy.SmsService;
import basics.proxy.staticProxy.SmsServiceImpl;

/**
 * @author jiangwz
 * @create 2021/3/10.
 */
public class DynamicDemo {

    public static void main(String[] args){

        SmsServiceImpl smsService = new SmsServiceImpl();

        SmsService  o = (SmsService) Proxy.newProxyInstance(
                smsService.getClass().getClassLoader(),
                smsService.getClass().getInterfaces(),
                new DebugInvocationHandler(smsService));

        o.send("1111");

    }
}
